package com.yq.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yq.domain.SysMenu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SysMenuMapper extends BaseMapper<SysMenu> {

    @Select("SELECT DISTINCT t1.* from sys_menu as t1 JOIN sys_user_role as t2 join sys_role_menu as t3 on\n" +
            "(t2.role_id = t3.role_id and t1.menu_id = t3.menu_id) WHERE user_id = #{value} and (type=1 OR type = 0) ORDER BY order_num desc")
    List<SysMenu> selectByUserId(Long valueOf);

}